package com.info.zhiduoduo.repository.dto.maker;

import com.alibaba.excel.annotation.ExcelProperty;
import com.info.zhiduoduo.common.excelconverter.MakerOpeningLocationConverter;
import com.info.zhiduoduo.common.excelconverter.MakerRealNameAuthConverter;

import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.BeanUtils;

import java.math.BigDecimal;
import java.util.Date;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)  //setter return this;
@ToString
public class DownloadStudioBriefDto {

	@ExcelProperty("注册日期")
	private Date createtime;

	@ExcelProperty("姓名")
	private String realname;

	@ExcelProperty(value = "实名状态", converter = MakerRealNameAuthConverter.class)
	private int realnameAuth;

	@ExcelProperty("身份证")
	private String idno;

	@ExcelProperty("手机号")
	private String phone;

	@ExcelProperty("工作室名称")
	private String username;

	@ExcelProperty(value = "注册地", converter = MakerOpeningLocationConverter.class)
	private int openingLocation;

	@ExcelProperty("月交易额")
	private BigDecimal monthBusiness;

	@ExcelProperty("季度交易额")
	private BigDecimal quarterBusiness;

	@ExcelProperty("年交易额")
	private BigDecimal yearBusiness;

	@ExcelProperty("过去十二个月交易额")
	private BigDecimal twelveMonthAmount;

	@ExcelProperty("银行卡号")
	private String acctno;

	public static DownloadStudioBriefDto of(StudioBriefDto dto) {
	    DownloadStudioBriefDto downloadStudioBriefDto = new DownloadStudioBriefDto();
	    BeanUtils.copyProperties(dto, downloadStudioBriefDto);
	    return downloadStudioBriefDto;
	}

}
